#ifndef CLIENT_H
#define CLIENT_H

#include <QThread>
#include <QtNetwork/QtNetwork>
#include <QMutexLocker>

#include "units/player.h"
#include "handlers/sessionhandler.h"
class Client : public QThread
{
    Q_OBJECT
public:
    Client(int socketDescriptor, QObject *parent);
    void run();

signals:
    void error(QTcpSocket::SocketError socketError);

public slots:
    void SetPlayer(Player* player);
    void SendData(QByteArray data);

private:

    int socketDescriptor;
    QTcpSocket *_Socket;
    Player* _player;
    Handlers::SessionHandler* handler;
    mutable QMutex mutex;
};

#endif // CLIENT_H
